#ifndef MYSQL_CONNECTION_H
#define MYSQL_CONNECTION_H

#include "ConnectionPool.h"
#include <mysql.h>

namespace serika
{
	namespace db
	{
		class MysqlConnection
		{
		public:
			MysqlConnection(ConnectionPool<MysqlConnection>& pool);
			~MysqlConnection();
	
		public:
			MYSQL* GetRawConnection();
	
			bool Create();
			void Close();
			bool Test();
			bool Reconnect();
	
		private:
			ConnectionPool<MysqlConnection>& mPool;
			MYSQL* mMysql;
		};
	
		typedef ConnectionPool<MysqlConnection> MysqlConnectionPool;
	}
}

#endif

